<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:a4j="http://richfaces.org/a4j">
  
<h:body>
	<h:form>
		<p:panel header="Search attractions by city">
			<h:panelGrid columns="3" id="regGrid">
				<h:outputLabel for="city">Insert the city of interest:</h:outputLabel>
				<p:inputText id="city" value="#{AttractionBean.city}" />
				<p:message for="city" />
				
				<h:outputLabel for="id">Id:</h:outputLabel>
				<p:inputText id="id" value="#{AttractionBean.id}" />
				<p:message for="id" />
				
				<p:commandButton value="Select the id you want to modify" update="regGrid" />
				
			</h:panelGrid>
				<p:commandButton value="Search!!" update="regGrid"
				action="#{AttractionBean.fillCityAttraction()}" />
		</p:panel>
		
		<h:dataTable value="#{AttractionBean.cityAttraction}" var="item">
    		<h:column>#{item}</h:column>
		</h:dataTable>
				
				<br />

		<h:link outcome="/admin/modifyAttraction" value="to Modify (remember the ID!! )" /> <br />
		
		
	</h:form>
	
	<h:form>
<p:panel header="Remove Attraction">	
		<h:panelGrid columns="3" id="regGrid5">	
<h:outputLabel for="id2">#Id:</h:outputLabel>
				<p:inputText id="id2" value="#{AttractionBean.id}" />
				<p:message for="id2" />		
				<p:commandButton value="Remove the typed Packet" action="#{AttractionBean.remove()}" update="regGrid5" />	
</h:panelGrid>
</p:panel>
</h:form>
</h:body>
<h:link outcome="/admin/index" value="HomePage" />
</html>